package com.ktvme.outTimeBoxState

import mu.KotlinLogging
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.CommandLineRunner
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.data.redis.core.RedisTemplate

@SpringBootApplication
class OutTimeBoxStateApplication : CommandLineRunner {
    private val log = KotlinLogging.logger {}

    @Autowired
    private lateinit var realTimeDataRedisTemplate: RedisTemplate<String, Map<String, Any>>

    private val outTime30Min = 30 * 60 * 1000

    override fun run(vararg args: String?) {
        processRedis()
//        calDifferent()
    }

    private fun processRedis() {
        val activeProfile = System.getProperty("spring.profiles.active", "unknown")
        log.info("当前正运行于 {} 模式下", activeProfile)

        val key = "BoxState:*"
        val keys = realTimeDataRedisTemplate.keys(key)
        log.info("redis 中有 {} 个商家房态", keys.size)
        val now = System.currentTimeMillis()
        val anHourAgo = now - outTime30Min
        val outTimeCompanyList = ArrayList<String>(keys.size)
        val inTimeCompanyList = ArrayList<String>(keys.size)
        val start = System.currentTimeMillis()
        val oldJTCompany = ArrayList<String>(keys.size)
        keys.stream().parallel().forEach { theKey ->
            val data = realTimeDataRedisTemplate.opsForValue().get(theKey)
            val companyCode = theKey.subSequence(theKey.length - 5, theKey.length).toString()
            if (data == null || null == data["type"]) {//旧精通商家
                oldJTCompany.add(companyCode)
                return@forEach
            }

            val dateInMis = (data["date"] ?: 0) as Long
            if (dateInMis < anHourAgo) {
                outTimeCompanyList.add(companyCode)
            } else {
                inTimeCompanyList.add(companyCode)
            }
        }
        val timeElapsed = System.currentTimeMillis() - start
        log.info("共耗时 {} 秒", timeElapsed / 1000)
        val outTimeCompanies = outTimeCompanyList.joinToString(",")
        log.info("旧精通商家，有 {} 家 \n 商家编码：\n {}", oldJTCompany.size, oldJTCompany.joinToString())
        log.info("超时商家有： {} 家", outTimeCompanyList.size)
        log.info("超时商家：{}", outTimeCompanies)
        log.info("未超时商家有： {} 家 \n, 未超时商家： \n {}", inTimeCompanyList.size, inTimeCompanyList.joinToString())
    }

    private fun calDifferent() {
        val idcBoxStateStr = """
            31720, 15833, 24403, 22434, 08778, 14483, 17680, 10360, 19427, 37175, 25332, 32088, 21467, 22171, 09492, 38585, 29016, 32371, 16009, 30837, 32439, 06724, 26535, 09066, 00933, 14812, 02674, 22866, 08855, 37413, 01437, 15531, 31652, 35325, 02991, 09987, 29110, 13589, 06447, 08866, 03487, 30132, 28520, 07986, 28879, 26054, 29359, 14076, 28645, 11505, 11699, 32350, 09526, 15137, 39671, 17659, 00510, 38665, 33853, 03426, 13602, 06245, 14647, 35226, 36245, 04806, 22803, 16936, 08516, 08851, 19344, 37901, 25323, 08284, 00572, 15321, 10930, 34310, 31349, 15049, 12783, 14174, 26293, 06639, 03581, 24088, 07732, 23872, 23702, 27382, 38540, 32388, 03670, 39086, 06113, 04441, 19049, 03226, 20445, 30668, 03886, 05291, 09143, 12084, 02645, 10118, 32373, 00953, 04979, 14151, 29491, 09483, 28641, 13861, 28687, 05389, 21340, 12535, 19593, 29163, 36248, 25604, 08998, 27119, 00317, 12675, 24701, 25887, 15050, 15664, 03443, 04109, 30422, 31508, 36227, 26129, 17288, 31042, 13056, 06766, 33983, 13950, 05919, 27092, 31840, 29347, 02714, 33477, 19118, 12358, 01973, 20115, 20234, 16597, 00770, 36748, 25349, 28114, 34791, 28644, 00311, 17965, 19788, 14353, 19270, 17334, 32677, 32504, 33548, 02926, 16728, 04345, 02833, 05256, 14153, 05700, 09811, 33667, 31674, 26066, 18917, 27704, 20001, 29598, 01041, 25041, 18629, 12030, 13618, 08509, 13204, 03032, 01100, 13581, 17637, 09381, 36514, 07001, 36102, 02097, 36571, 25292, 16903, 28762, 37340, 11108, 26033, 14681, 14853, 33433, 17482, 07031, 02182, 25711, 02091, 37329, 08447, 29991, 38753, 03290, 22342, 35673, 13464, 27763, 12028, 22838, 14329, 36020, 16510, 02427, 23393, 06148, 04711, 30674, 17171, 31922, 28120, 21722, 38544, 38854, 01554, 24388, 04181, 34217, 11001, 22156, 31656, 36868, 23881, 11079, 39704, 04500, 31342, 08088, 40030, 35810, 07225, 18126, 11622, 03952, 20376, 07533, 15223, 28625, 17782, 03862, 33693, 11930, 23219, 38194, 26057, 24327, 33511, 33850, 36369, 36654, 34605, 35412, 29692, 34352, 37471, 35454, 07751, 28586, 39436, 25358, 28800, 03731, 13382, 31201, 25372, 22087, 03610, 19939, 16511, 08834, 26117, 24211, 03606, 35917, 25426, 15772, 18639, 40079, 03014, 30444, 37898, 05772, 33041, 05180, 35038, 05202, 18840, 39235, 30061, 08793, 34928, 12499, 13869, 28514, 05887, 13506, 38157, 37366, 22874, 09856, 25002, 02751, 21544, 16382, 40035, 36460, 14367, 09450, 19111, 27886, 00527, 19631, 22459, 15590, 18567, 32490, 19184, 26652, 25941, 11086, 16347, 25569, 21948, 09951, 28240, 22893, 10169, 03456, 33785, 27586, 14612, 18720, 16378, 05904, 30637, 23225, 36180, 30188, 14021, 16803, 36480, 06083, 03971, 09971, 03437, 35777, 35994, 24108, 29007, 33065, 04052, 02021, 15255, 33303, 07283, 39232, 27486, 03442, 33406, 02261, 05343, 19201, 06301, 01336, 34052, 14953, 05055, 30839, 37721, 05023, 33888, 18990, 32894, 00535, 09996, 35041, 17654, 08557, 08320, 39920, 37081, 08785, 11726, 02169, 01447, 03973, 32369, 27882, 38637, 37810, 20752, 21969, 02679, 30607, 30448, 32559, 23888, 24795, 25166, 21119, 19186, 04273, 31662, 26664, 33955, 33073, 05024, 36682, 31939, 37235, 02806, 24999, 27842, 10336, 36431, 13508, 13607, 04326, 23647, 06928, 31762, 17141, 35380, 26022, 19051, 36700, 39163, 28902, 29483, 21374, 09003, 24449, 31603, 38379, 24008, 19533, 19274, 07557, 28270, 35385, 07841, 33996, 30585, 38603, 09435, 03652, 32523, 02941, 21895, 37210, 08683, 20683, 01193, 03217, 07591, 03919, 39124, 03793, 37525, 28140, 31600, 17832, 29035, 07496, 04876, 36288, 30682, 31714, 22913, 30414, 20782, 03791, 08271, 19670, 38666, 14572, 26246, 16052, 27852, 07119, 13925, 24705, 13349, 00481, 25003, 03132, 29218, 14374, 30086, 30960, 29425, 27085, 36331, 35522, 13733, 23963, 27885, 00912, 00592, 34755, 16407, 09574, 35056, 37470, 36549, 09525, 29838, 19295, 03526, 11331, 27584, 14455, 37520, 21774, 36705, 03252, 00862, 03593, 03062, 36795, 21239, 04740, 02519, 23149, 34906, 17069, 32656, 20966, 28290, 16336, 18986, 36345, 02142, 24442, 13747, 26582, 35383, 12317, 29044, 38215, 19221, 32006, 04703, 18926, 30000, 29839, 01700, 29982, 06397, 25576, 39087, 14177, 39418, 09860, 37093, 18084, 09077, 15451, 23103, 31850, 16374, 19150, 21355, 18227, 25295, 36786, 30718, 37681, 01882, 25022, 08974, 05860, 12069, 01089, 28505, 37935, 32321, 16969, 02731, 31367, 37786, 08657, 02200, 37742, 35349, 36224, 00486, 17554, 11854, 03331, 29294, 21044, 10576, 07940, 27375, 09616, 07523, 36732, 37305, 01321, 04414, 11666, 19158, 29402, 26222, 08760, 02703, 20057, 36703, 25418, 20237, 18218, 36223, 17696, 18814, 03926, 21965, 19340, 04813, 40003, 01208, 12816, 06146, 38039, 18507, 38389, 19444, 24632, 23973, 01173, 07271, 29436, 31156, 19341, 30508, 25754, 36432, 06738, 24329, 31988, 09042, 05702, 15949, 38608, 07809, 36016, 13923, 12211, 05795, 29918, 09020, 24658, 02197, 36929, 02955, 05243, 00821, 09446, 29538, 28497, 01202, 13858, 03702, 09785, 25749, 08995, 36347, 36915, 32855, 32758, 09942, 31056, 19429, 19389, 13919, 04387, 23480, 16934, 30073, 31651, 36259, 30227, 23432, 30696, 39183, 12991, 32432, 31688, 36610, 28427, 25151, 12689, 25216, 30114, 06293, 20918, 01984, 37491, 31666, 36911, 35574, 37528, 02615, 14636, 27843, 36658, 25671, 12053, 18782, 12397, 05261, 08784, 15896, 09629, 13978, 02174, 26734, 38238, 31416, 32064, 22100, 28724, 23930, 05893, 16703, 17608, 32400, 37307, 08070, 13273, 16749, 08540, 00765, 25218, 18390, 25407, 11375, 30202, 25324, 19461, 22316, 35061, 03625, 39353, 18529, 36069, 25147, 34539, 12629, 07269, 34000, 11055, 06448, 25666, 26398, 22506, 29835, 00532, 22629, 02605, 24330, 11345, 04763, 31180, 17671, 38584, 37232, 23528, 30258, 35009, 30862, 17888, 34309, 07613, 13048, 14935, 17527, 08483, 02228, 10048, 29219, 35741, 13505, 29486, 27553, 21463, 01347, 15316, 25148, 04192, 34890, 26154, 17763, 07973, 39760, 36709, 05083, 33965, 25446, 27362, 32051, 28369, 31907, 08136, 38807, 20037, 10914, 32488, 07166, 02409, 36178, 07946, 37955, 25758, 30571, 08361, 02774, 07676, 27537, 36025, 01871, 13635, 17416, 06580, 30103, 35540, 19958, 38837, 12997, 19237, 35944, 35859, 13971, 35024, 10638, 14614, 25531, 02974, 09797, 32100, 01127, 04736, 39152, 11434, 36365, 38488, 11902, 09791, 18695, 34670, 36883, 12815, 18816, 35042, 18076, 37653, 11355, 22363, 13197, 03213, 06948, 09404, 01403, 25567, 25315, 38290, 09546, 18914, 30528, 27376, 37987, 09232, 18014, 31800, 31540, 36282, 33530, 15411, 24197, 09662, 39838, 02708, 21510, 39014, 03887, 03393, 29800, 01049, 17640, 24813, 28550, 11661, 03490, 32382, 37830, 21729, 25653, 24925, 21132, 23761, 18407, 23953, 16542, 07350, 30545, 01087, 31185, 23000, 33286, 26671, 09119, 05678, 15140, 19219, 14646, 28935, 36434, 17068, 22820, 17258, 07724, 30954, 35708, 28970, 03377, 02977, 36726, 36545, 19413, 00795, 04040, 12907, 22945, 04580, 24970, 10664, 25317, 15514, 06586, 33316, 12334, 08504, 31294, 26085, 03021, 13401, 01098, 06032, 37988, 29672, 14695, 18600, 02763, 10828, 31229, 38681, 31478, 06812, 38994, 23866, 13073, 03425, 13571, 25748, 15910, 36751, 36581, 23088, 31369, 07514, 34812, 00954, 01290, 37430, 09318, 29595, 12680, 29836, 35870, 09737, 35889, 32315, 24133, 29366, 09865, 34273, 17304, 36886, 29746, 06405, 29762, 32478, 31169, 22939, 02184, 37379, 14118, 23783, 12896, 39228, 13684, 31392, 20052, 18911, 28113, 13939, 01094, 14259, 06872, 16093, 05351, 35307, 08971, 37126, 06610, 35053, 26750, 35147, 05208, 16453, 20902, 39354, 04633, 18696, 22982, 11216, 21542, 15080, 32424, 21808, 17869, 22055, 02246, 04586, 00914, 15823, 12489, 13025, 13106, 34963, 21073, 19431, 07352, 22002, 19268, 25900, 35877, 21353, 37594, 26485, 17367, 08930, 06907, 10271, 19056, 17311, 36728, 05679, 31721, 36249, 02616, 12724, 19012, 31542, 31947, 28353, 39334, 18085, 33605, 10782, 30317, 35683, 38750, 33139, 27332, 10992, 37334, 28357, 01382, 19162, 03680, 28053, 07164, 06640, 12794, 06176, 23446, 05113, 29572, 31805, 06414, 00186, 18593, 20458, 14437, 15701, 25973, 33789, 33952, 26766, 08502, 11805, 01212, 18236, 21860, 38933, 17145, 34699, 30666, 04220, 22633, 13955, 31684, 07483, 39539, 04558, 05112, 22355, 07244, 33908, 25341, 00401, 15551, 15068, 38889, 04984, 30959, 36708, 16844, 02042, 25465, 25233, 05674, 01927, 29249, 38055, 29344, 01418, 17099, 24623, 17336, 04888, 05170, 39870, 32322, 18292, 08472, 14246, 24669, 26299, 30322, 13929, 14532, 29260, 17756, 12478, 33999, 02414, 04865, 16671, 04910, 25263, 27214, 07923, 23820, 22520, 01427, 02347, 38864, 19202, 35306, 38115, 02234, 28776, 13554, 15847, 08653, 24976, 14567, 08487, 13707, 18348, 24894, 12567, 21437, 04645, 22708, 07634, 08642, 37620, 21775, 24698, 27391, 00277, 18226, 31530, 35241, 35844, 18623, 13541, 00447, 19406, 28612, 33980, 17282, 19770, 24318, 34858, 24809, 14999, 39433, 13322, 04026, 32041, 26736, 12856, 28672, 02382, 23524, 14044, 23199, 08918, 34413, 21698, 30591, 27988, 06465, 32889, 01220, 22162, 07191, 04171, 28647, 34898, 34867, 04402, 24005, 19290, 04681, 05142, 08893, 09354, 08631, 01519, 39343, 12162, 37108, 10752, 26447, 34878, 30936, 08710, 33804, 36003, 05031, 33290, 34267, 36279, 04005, 39231, 37603, 37624, 12014, 03876, 30826, 10203, 09418, 19405, 18931, 15879, 23208, 04301, 34663, 02592, 14464, 05850, 13350, 30792, 24307, 26228, 37205, 10117, 25741, 26121, 26427, 04388, 23507, 28581, 09851, 36991, 11332, 25599, 18280, 38218, 28303, 24235, 13811, 36198, 24025, 02277, 18522, 16747, 01701, 24794, 26614, 36108, 07463, 36092, 07433, 12398, 02332, 07650, 04286, 08823, 26560, 36246, 26328, 37197, 30542, 39717, 12671, 17718, 29362, 35249, 32861, 03554, 04728, 16380, 39933, 21235, 23176, 28512, 28764, 14210, 24518, 03612, 13532, 21900, 06643, 18262, 13744, 13789, 37567, 31830, 04849, 16614, 20140, 24187, 34503, 18308, 36169, 05432, 04683, 31309, 18319, 37736, 11913, 18433, 07907, 07491, 08835, 10085, 13916, 27270, 15710, 27538, 10274, 38198, 11050, 04987, 17426, 30425, 33514, 00449, 02407, 09316, 07521, 34622, 34581, 21105, 32241, 08357, 36018, 25471, 14993, 36243, 05721, 07065, 02463, 10022, 25172, 37507, 32036, 19464, 01341, 24577, 28236, 00871, 04035, 37374, 21548, 39593, 34115, 32130, 34940, 38872, 00496, 34582, 29823, 36825, 28015, 21793, 30113, 11846, 22721, 36308, 10473, 18574, 39229, 39009, 37821, 33970, 07296, 11354, 32970, 08626, 05232, 31575, 16420, 28216, 37473, 24668, 15968, 03804, 18473, 08886, 31668, 26867, 04989, 37294, 31495, 35111, 35311, 05605, 00755, 09547, 35763, 20393, 26275, 07699, 04302, 18742, 23634, 02024, 12041, 13981, 03568, 02214, 13286, 04376, 32881, 37019, 02030, 21191, 04496, 30262, 29724, 25328, 14670, 09103, 39056, 32680, 31147, 34743, 01906, 01907, 10755, 00869, 19632, 24738, 00325, 30284, 12636, 31083, 20259, 31635, 04158, 31063, 35937, 05565, 19352, 37339, 30700, 13597, 28936, 24287, 32173, 10823, 02163, 20831, 36655, 38412, 37069, 14138, 14477, 02061, 13132, 35701, 36796, 11384, 08576, 31639, 10506, 07012, 38205, 05357, 28953, 02023, 26308, 27810, 29494, 04892, 13495, 20618, 24897, 09591, 18497, 31347, 04925, 16060, 36468, 31551, 04986, 19251, 15565, 07876, 12188, 25024, 17534, 13280, 12748, 12387, 37572, 20364, 31873, 07291, 08663, 00777, 33484, 37317, 00485, 07117, 10950, 12224, 31017, 35652, 31624, 05262, 09986, 08634, 36521, 35882, 05579, 30621, 25560, 04591, 00679, 12197, 33773, 39677, 12736, 06699, 39437, 25171, 17719, 30980, 25154, 13393, 18935, 24835, 05557, 14741, 07532, 00289, 00366, 33764, 05764, 15307, 03448, 06544, 21278, 35163, 39262, 39373, 35265, 30757, 13562, 09035, 01696, 03853, 28162, 03036, 05325, 01165, 28354, 05353, 26790, 39847, 18559, 28400, 27053, 33634, 05137, 12486, 32087, 17033, 18307, 01771, 31593, 37738, 25473, 04613, 38715, 01970, 16502, 30269, 10762, 30050, 39062, 11124, 02218, 02948, 05831, 11262, 34631, 25360, 30636, 34792, 12695, 06000, 17215, 01645, 28920, 28263, 25187, 31703, 00360, 38425, 11038, 33151, 16866, 30368, 06098, 30344, 02307, 32788, 06763, 28025, 14468, 17384, 30858, 04656, 11166, 24756, 19534, 04384, 07115, 35582, 03402, 10675, 36123, 16914, 26655, 31191, 31885, 29025, 16048, 09863, 21667, 08697, 32328, 39068, 02040, 12336, 20346, 14447, 32943, 32892, 26333, 18748, 21035, 12704, 13333, 21872, 21927, 32538, 18462, 28358, 33782, 23822, 37116, 29379, 33907, 36568, 08956, 13522, 28608, 29015, 12299, 12925, 29797, 14164, 26430, 29760, 36485, 08556, 04285, 18915, 08234, 26764, 02548, 17505, 22194, 01794, 39856, 11673, 05264, 16558, 17819, 18217, 17820, 15653, 13015, 04013, 26510, 30384, 16434, 02244, 30222, 12798, 12076, 19808, 29281, 29560, 00907, 12324, 28583, 14546, 12577, 36968, 27457, 11877, 08060, 07479, 10922, 18853, 12920, 29459, 03912, 19840, 39083, 38066, 27351, 28207, 09577, 26437, 32089, 19098, 28530, 04522, 36958, 04277, 04170, 03646, 10493, 08561, 21777, 05378, 00981, 24411, 37395, 30766, 30945, 00416, 29968, 10505, 29183, 18951, 09975, 09367, 33252, 19392, 30836, 29960, 30920, 19322, 38017, 03243, 37176, 10011, 09846, 14631, 02721, 02859, 06852, 14570, 09576, 13517, 17564, 28844, 35547, 39399, 08308, 17067, 28111, 10488, 28393, 34083, 27976, 28582, 12812, 39868, 30380, 21232, 16965, 10908, 19625, 22897, 22352, 08910, 03658, 35468, 30305, 24729, 20241, 26454, 10843, 12250, 04046, 17726, 17009, 19310, 25449, 07110, 17119, 25326, 13690, 12646, 16506, 13176, 14843, 34970, 18498, 00191, 30885, 19188, 07997, 05287, 01162, 19437, 34346, 09545, 31864, 36430, 15845, 05730, 03332, 17891, 06583, 30199, 33026, 23189, 33524, 39166, 11187, 06587, 06729, 14740, 23154, 32696, 14074, 37534, 03439, 28585, 24270, 22572, 29730, 31293, 27103, 26556, 05018, 23627, 30745, 30059, 12065, 22435, 07933, 31529, 08831, 35807, 37682, 38643, 18141, 11662, 22580, 29957, 09962, 37196, 30001, 25235, 26375, 37868, 07048, 18318, 34879, 31876, 31247, 30379, 39309, 26218, 25007, 31704, 33849, 37953, 16035, 20072, 21016, 14630, 02213, 11328, 38319, 14248, 29427, 06984, 11547, 33324, 20475, 36027, 29900, 31489, 15658, 31427, 09087, 20386, 31490, 39566, 05567, 32581, 22128, 28966, 07645, 25775, 38808, 18690, 34152, 35758, 08512, 21273, 11757, 16175, 31532, 30115, 07954, 14012, 02646, 24989, 30244, 27636, 35506, 19153, 32223, 32614, 09206, 14512, 37453, 11749, 03942, 06637, 05587, 17239, 29901, 36690, 05371, 12169, 03665, 07895, 35473, 02018, 24829, 19782, 00630, 12941, 01979, 22625, 24515, 17850, 17694, 33692, 11128, 21206, 00776, 39284, 09578, 25371, 14143, 32915, 27368, 14305, 17794, 28499, 06126, 35373, 38820, 28698, 29512, 36029, 40056, 29101, 11978, 31038, 07033, 09645, 07647, 37518, 38530, 23124, 25866, 05815, 13898, 00768, 25708, 36447, 16771, 01716, 08622, 23833, 14069, 02620, 36179, 30903, 16292, 35657, 07654, 06484, 35043, 25106, 16804, 31781, 20307, 21913, 13830, 13865, 18750, 08659, 17657, 28810, 14510, 17289, 01293, 09724, 35328, 30783, 05070, 17936, 17192, 18029, 34651, 03025, 26173, 20247, 27968, 18724, 00654, 34912, 31713, 03957, 13706, 14771, 11962, 02520, 16667, 00301, 02851, 13889, 26588, 05829, 31951, 04604, 24331, 16306, 25559, 28355, 24977, 08370, 29587, 29824, 31930, 33115, 37454, 30704, 18563, 26617, 08620, 09948, 05780, 31391, 00230, 22387, 11540, 06022, 34179, 09561, 13301, 18873, 06509, 09967, 31037, 18826, 09136, 06237, 16727, 15985, 24898, 35738, 01198, 15496, 23431, 01566, 38013, 37368, 31373, 37568, 02775, 32167, 32230, 07373, 20311, 09726, 04926, 33541, 38447, 28219, 05699, 32750, 01412, 27860, 30034, 12342, 03114, 10891, 30357, 18597, 03328, 18844, 32170, 37312, 25280, 34371, 16999, 10287, 18992, 13661, 05399, 04091, 36672, 34688, 08750, 21639, 01436, 03502, 13569, 30145, 28697, 02582, 13304, 39260, 29673, 22523, 23175, 30297, 02340, 09233, 27938, 31140, 36366, 17126, 07385, 35124, 17689, 33995, 29633, 38384, 18436, 29728, 28587, 03134, 32004, 22670, 37565, 18621, 09064, 29481, 02096, 18313, 17708, 30855, 31512, 14669, 02079, 31718, 07578, 19183, 05728, 01121, 23271, 38357, 30232, 23260, 36115, 09288, 31672, 34240, 03410, 16023, 22215, 34071, 06500, 26940, 39576, 28828, 23502, 33390, 35217, 23632, 09063, 12697, 12637, 31057, 18291, 13770, 31012, 04392, 10570, 29557, 25191, 28600, 30092, 09659, 13742, 22998, 30427, 35381, 07697, 23476, 15381, 36711, 09342, 07719, 03808, 36976, 25620, 28795, 03483, 32180, 10779, 07053, 21402, 24922, 16964, 31996, 36420, 14494, 00381, 21122, 18964, 17199, 04113, 38504, 30559, 28101, 38068, 09802, 16507, 10645, 32819, 36015, 09503, 11473, 11542, 25947, 35192, 34259, 01901, 09882, 22449, 31463, 02330, 00546, 36226, 25869, 33810, 05509, 26167, 30569, 02308, 08798, 29212, 11952, 15831, 04506, 09848, 13700, 04758, 01180, 19951, 19090, 32376, 24410, 28663, 27040, 28457, 09872, 31029, 10889, 14595, 00690, 19786, 21334, 20348, 07464, 15992, 21982, 25217, 30818, 28792, 24511, 38709, 31307, 38084, 36778, 37943, 13453, 13075, 27570, 19634, 13070, 00160, 39091, 32638, 17881, 03911, 05308, 19265, 14854, 35567, 37001, 08381, 12779, 34629, 03129, 16366, 07752, 17940, 03847, 31708, 37855, 16942, 02029, 14598, 13156, 24973, 38492, 20821, 25109, 38821, 08838, 15450, 33919, 18068, 11936, 07015, 05616, 21958, 18134, 37086, 07690, 22351, 15882, 33749, 32939, 30987, 31756, 17335, 38261, 27908, 25972, 01115, 18541, 33936, 22926, 09255, 33880, 09702, 10564, 10973, 18442, 11580, 38378, 11819, 26185, 26641, 31274, 03531, 08009, 09570, 15953, 13419, 21138, 12754, 08837, 00586, 08767, 00363, 24482, 34490, 01095, 08066, 14724, 27853, 05468, 06272, 06999, 36755, 16796, 33631, 16581, 39053, 17278, 34487, 00276, 39508, 28142, 00425, 05373, 18129, 23287, 34255, 11343, 26182, 11597, 30824, 01577, 19439, 16209, 38870, 31730, 19227, 11319, 38234, 12490, 37189, 09245, 36151, 32644, 23545, 03281, 30583, 27703, 31033, 31968, 03609, 32579, 27733, 24908, 18520, 17537, 25067, 36319, 18949, 09670, 01292, 23904, 29493, 04173, 13608, 24990, 14152, 23332, 04793, 14345, 11865, 13227, 19497, 08292, 31408, 38908, 07832, 30171, 35619, 06613, 08422, 03295, 32625, 01809, 35868, 36784, 27442, 10323, 16356, 12353, 04563, 10481, 01651, 21901, 21215, 14659, 20762, 36724, 36158, 23304, 31085, 38201, 08282, 03564, 14328, 03409, 30025, 30091, 35731, 14628, 09787, 02044, 35130, 02294, 15227, 38606, 18790, 02658, 24215, 36199, 19430, 36439, 31262, 13801, 31072, 37256, 15220, 20810, 28249, 08707, 16691, 03277, 39739, 01632, 10236, 14226, 18946, 13693, 00751, 08817, 09399, 19138, 09921, 12013, 10980, 01941, 22479, 07824, 39011, 13727, 25015, 05800, 29977, 10305, 07843, 18725, 36429, 26573, 36653, 37566, 26471, 31895, 28349, 00389, 14974, 13980, 38478, 17389, 13146, 09442, 02787, 26863, 36575, 03117, 27302, 04871, 06551, 32682, 03387, 34429, 05041, 16814, 16473, 28392, 18470, 18474, 14396, 13828, 03681, 13228, 35655, 09436, 09006, 05573, 38431, 33318, 05228, 31376, 13740, 04893, 18413, 05521, 37228, 28238, 25498, 31213, 19042, 18440, 14673, 37162, 08879, 39103, 27498, 19127, 17634, 09364, 36174, 38806, 29143, 33388, 23066, 10842, 00846, 05210, 08875, 11212, 34235, 10586, 05165, 33260, 29643, 28833, 11684, 38795, 33734, 19110, 20477, 22307, 13010, 13386, 25940, 09901, 10837, 25656, 08829, 03069, 12008, 26264, 24472, 00529, 15690, 09011, 07303, 36281, 16305, 36146, 32468, 07683, 12669, 08415, 21744, 38331, 02617, 05517, 15646, 14355, 25122, 24136, 03441, 28933, 36037, 07649, 36330, 37605, 30372, 19977, 36044, 30741, 36433, 02412, 06171, 12884, 28456, 30645, 08994, 16593, 14407, 11912, 13996, 06771, 38694, 11945, 33571, 37589, 36070, 25688, 16825, 30622, 30356, 22882, 26745, 38291, 36235, 25283, 34229, 12761, 37187, 38446, 29261, 30252, 18414, 36482, 18363, 03852, 20729, 22915, 02817, 22954, 08270, 12278, 03401, 10220, 37322, 28286, 05230, 21307, 37111, 35939, 06468, 13555, 09668, 34336, 06504, 38999, 21375, 25630, 14034, 01144, 12784, 38990, 18059, 35361, 09161, 26178, 30595, 37248, 31034, 26008, 24428, 31339, 21248, 14189, 31927, 06710, 19228, 09745, 22464, 11919, 39387, 09010, 19623, 31013, 14149, 23196, 11435, 08899, 00472, 32182, 17551, 01989, 15516, 30561, 25167, 16512, 31731, 18265, 07960, 35914, 07567, 25515, 15228, 30724, 00288, 31975, 11200, 37053, 00734, 04278, 17879, 39082, 30204, 33417, 36414, 28599, 15348, 30312, 15322, 11798, 15789, 39043, 12200, 25258, 05684, 21718, 26991, 30662, 21643, 03548, 35798, 37967, 29070, 09340, 12445, 15920, 00875, 05511, 29764, 17961, 27808, 39304, 28166, 25790, 26772, 31935, 29894, 26920, 19452, 27466, 27665, 36398, 21540, 17111, 17266, 31604, 05102, 04947, 25389, 02158, 09796, 08430, 35070, 17925, 14913, 25268, 09183, 25633, 30702, 13837, 39438, 12943, 35875, 22024, 13631, 25822, 14182, 24713, 02280, 12849, 21253, 14576, 21049, 16281, 08965, 09479, 04595, 14472, 04638, 24988, 31280, 29352, 35484, 34542, 17295, 12430, 26947, 25943, 23237, 26309, 32271, 33015, 36134, 18670, 35409, 20606, 34156, 08948, 24024, 13161, 28467, 18662, 18357, 29011, 28429, 01853, 14178, 30639, 32115, 04666, 30832, 32648, 18224, 11444, 13096, 35756, 06247, 31431, 17469, 26210, 03170, 31857, 18369, 13827, 30801, 30485, 39144, 00446, 03687, 35838, 26048, 08125, 30516, 39574, 05987, 23615, 32394, 20450, 35795, 01378, 12115, 18513, 31073, 34160, 13712, 27738, 26466, 36237, 05865, 39201, 30006, 35533, 37464, 13385, 32797, 09256, 04790, 01103, 34203, 33480, 20855, 15492, 01300, 17639, 31168, 35641, 14125, 16829, 28827, 14144, 35208, 39749, 01881, 00651, 08926, 15742, 10748, 22839, 34332, 24775, 31353, 30941, 06848, 15921, 18712, 31205, 25245, 03477, 08302, 11636, 02700, 33632, 20326, 39957, 07278, 10438, 19783, 30701, 36620, 05173, 29975, 23401, 08876, 25219, 05323, 26332, 08077, 15356, 22478, 15665, 37993, 25036, 13515, 23123, 13844, 21940, 03067, 38656, 37233, 20352, 19076, 30240, 38459, 17485, 16082, 04234, 29330, 30421, 13381, 11792, 13633, 05005, 13384, 03136, 28471, 21471, 20909, 09120, 18740, 01497, 28606, 10883, 02745, 14311, 02655, 01178, 01791, 38416, 35293, 27621, 17953, 18336, 40110, 04292, 13720, 25944, 18984, 26095, 38088, 23874, 25048, 11860, 30686, 31079, 32663, 38912, 31468, 25427, 31203, 35780, 36306, 28686, 03833, 14023, 09722, 22315, 06730, 09403, 31259, 25525, 31239, 01333, 10921, 37765, 30093, 04974, 09505, 14047, 31364, 20421, 21700, 22072, 11195, 03683, 18425, 35333, 29608, 13084, 04912, 39597, 40045, 39297, 30253, 36920, 00559, 18061, 03924, 28614, 27441, 06780, 09747, 02275, 07586, 04189, 31802, 06596, 38165, 25729, 08307, 40000, 09438, 07771, 16673, 08898, 25518, 36024, 11005, 00400, 23256, 13196, 39485, 18500, 27492, 25868, 31279, 08652, 15097, 35808, 34882, 19325, 38129, 11305, 25951, 13093, 35194, 23342, 27177, 05908, 30890, 34696, 06409, 30889, 12343, 19001, 36821, 26602, 29837, 19438, 23344, 37504, 15860, 04611, 04320, 16152, 01460, 13904, 38601, 03799, 11968, 39917, 05034, 05277, 05075, 09585, 12752, 21041, 05760, 10669, 16388, 28017, 38663, 30830, 16261, 08289, 37414, 06264, 31878, 08097, 14010, 37324, 11970, 04321, 25440, 34516, 23091, 18843, 13534, 02013, 32570, 24656, 18923, 26356, 18889, 26029, 25214, 28615, 18124, 29012, 36375, 18599, 37570, 26546, 18194, 30480, 08671, 37763, 30642, 28466, 25400, 19619, 15802, 08273, 01780, 30829, 05386, 37214, 02380, 06342, 22068, 12558, 06966, 11984, 05514, 37054, 35924, 31232, 27898, 09474, 15245, 33593, 15291, 16120, 28954, 04770, 26688, 14757, 22411, 19173, 18516, 00951, 13565, 39525, 17362, 23150, 38213, 03758, 03356, 25532, 28100, 29646, 08944, 11911, 14098, 20614, 30563, 26068, 27063, 18487, 38791, 09910, 12585, 08238, 12965, 30080, 37146, 38622, 28890, 29842, 38534, 25774, 08962, 00600, 04832, 35770, 36267, 17532, 39000, 06709, 38521, 15100, 01662, 36917, 24278, 14983, 40124, 17621, 35925, 12520, 14172, 09160, 22225
        """.trimIndent()
        val idcCompanySet: Set<String> = idcBoxStateStr.split(",").toList().map { it.trim() }.toSet()

        val aliyunBoxStateStr = """
            37126,29218,04989,15512,37393,29824,08357,39808,07667,39219,36514,31703,28810,38876,22506,14021,38909,26573,29838,01696,03535,28645,18640,37716,22902,31309,29644,15290,39310,16542,37434,36851,20902,07031,04704,26386,25187,28764,06448,06798,31342,18592,32373,38527,19605,16524,31311,28513,03665,35701,22388,28208,11505,24482,27521,09650,17099,18357,13830,36958,12299,07607,28232,36545,30169,32577,00385,34792,01198,03197,05387,38258,04522,23225,20001,16175,09478,09726,18946,25122,24585,39304,33317,24837,34242,25164,16697,27486,02412,33318,07814,34337,15949,37096,31415,03564,37620,34688,06586,06494,34963,00473,26692,07393,04383,00484,14305,34623,04888,13176,28299,36976,08366,39091,17176,38218,28953,23833,12896,21555,05070,33996,21274,08829,00406,13120,36604,31704,36012,26308,24997,02038,00862,36908,17708,30858,02548,22228,04925,36607,39350,29101,33667,08707,29459,08671,09737,39262,09622,39561,37415,33888,02918,07907,39508,08348,37149,20269,15100,11435,39737,39309,16753,36494,36708,38158,01378,38373,13478,17565,28837,13532,37487,05232,33907,03295,24330,37248,08125,17532,01414,36937,05780,29035,35725,20037,25982,14238,36384,08556,19201,26947,17097,06377,10323,36089,00774,26454,07110,38240,11107,32170,31639,36808,36213,02605,30637,18548,13742,27392,19977,03254,21284,14295,14678,29643,03606,02704,34267,36972,31635,39246,26471,26367,04286,12351,07668,29753,37257,36524,37871,37453,34484,15435,22572,27853,25630,14152,36151,31408,31508,33642,04858,33139,34539,35009,34022,25260
        """.trimIndent()
        val aliyunCompanySet = aliyunBoxStateStr.split(",").toList().map { it.trim() }.toSet()

        val difference = idcCompanySet.minus(aliyunCompanySet)
        println("difference space: ${difference.size}\n details:\n $difference")

    }
}

fun main(args: Array<String>) {
    runApplication<OutTimeBoxStateApplication>(*args)
}


